def compare_files(file1, file2):
    with open(file1, 'r', encoding='utf-8') as f1, open(file2, 'r', encoding='utf-8') as f2:
        lines1 = f1.readlines()
        lines2 = f2.readlines()

        # if len(lines1) != len(lines2):
        #     print("The files have different number of lines.")
        #     return

        for line_num, (line1, line2) in enumerate(zip(lines1, lines2), start=1):
            if line1 != line2:
                print(f"Difference found at line {line_num}:")
                print(f"File1: {line1.strip()}")
                print(f"File2: {line2.strip()}")
            else:
                print(f"Line {line_num} is the same in both files.")


if __name__ == '__main__':
    # Example usage
    file1 = 'log-20230407-091848.txt'
    file2 = 'log-20230407-091854.txt'

    compare_files(file1, file2)


